<template>
  <div class="container">
    <div class="operate">
      <slot></slot>
      <div style="margin-left: auto">
        <el-select
          v-model="value"
          size="small"
          placeholder="Select"
          style="width: 120px"
        >
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </div>
      <slot name="op"></slot>
    </div>
    <div
      :style="{ maxHeight: item.h * 40 - 70 + 'px' }"
      class="content"
      v-if="!!item?.data?.projectUpdatesVoList?.length"
    >
      <el-timeline style="max-width: 600px">
        <el-timeline-item
          v-for="(activity, index) in item?.data?.projectUpdatesVoList"
          :key="index"
          :icon="activity.icon"
          :type="activity.type ?? 'primary'"
          :color="activity.color ?? 'skyblue'"
          :size="activity.size"
          :hollow="activity.hollow"
          :timestamp="activity.createTime"
        >
          {{ activity.actionDetail?.["zh_CN"] }}
        </el-timeline-item>
      </el-timeline>
    </div>
    <NoData v-else />
  </div>
</template>

<script setup lang="ts">
  /**
   * @description 业务组件 -- 项目动态
   */
  import { ref } from "vue";
  defineProps(["item"]);
  import NoData from "./commonCom/NoData.vue";
  const value = ref("");

  const options = [
    {
      value: "Option1",
      label: "全部人员",
    },
    {
      value: "Option2",
      label: "部分人员",
    },
  ];
</script>

<style scoped lang="scss">
  .container {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0px 10px 10px;
    font-size: 14px;
    color: #999;
    .header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-weight: 500;
      font-size: 16px;
      color: #141414;
      height: 30px;
      .header-right {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        padding: 0px 5px;
      }
    }

    .content {
      box-sizing: border-box;
      flex: 1;
      display: flex;
      flex-direction: column;
      margin-top: 10px;
      overflow: auto;
    }
  }
  .operate {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }
</style>
